/****************************************************
          File Name:12-3.h
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Fri 26 Dec 2014 02:20:19 PM CST
*****************************************************/

#ifndef THIS_H_
#define THIS_H_
#include<iostream>

using std::ostream;

class Stock
{
    private:
        char *company;
        int shares;
        double shares_val;
        double total_val;
        void set_tot() { total_val = shares * shares_val; }
    public:
        Stock();
        Stock(const char *co, long n = 0,double pr = 0.0);
        ~Stock();

        void buy(long num, double price);
        void sell(long num, double price);
        void update(double price);
        friend ostream & operator<<(ostream & os, const Stock & s);
        const Stock & topval(const Stock & s) const;
};

#endif
